<?php
一、编码规则
	1.整站默认UTF-8编码无BOM
	2.每个缩进的单位约定是一个Tab(禁止设置为空格替代，Tab宽度应表示为4个空白字符宽度)，需每个参与项目的开发人员在编辑器(UltraEdit、EditPlus、ZendStudio等)中进行强制设定，以防在编写代码时遗忘而造成格式上的不规范。
	3.项目中使用Unix风格的换行符，即只有换行( LF 或 "\n" )没有回车( CR 或 "\r" )，请在你的编辑器内调整

--
-- 表的结构 `ims_account`
--

CREATE TABLE IF NOT EXISTS `ims_account` (
	`acid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '子公众号 ',
	`uniacid` int(10) unsigned NOT NULL 			COMMENT '统一公众号 ',
	`hash` varchar(8) NOT NULL,
	`type` tinyint(3) unsigned NOT NULL,
	`isconnect` tinyint(4) NOT NULL,
	`isdeleted` tinyint(3) unsigned NOT NULL,
	PRIMARY KEY (`acid`),
	KEY `idx_uniacid` (`uniacid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_account_wechats`
--

CREATE TABLE IF NOT EXISTS `ims_account_wechats` (
	`acid` int(10) unsigned NOT NULL,
	`uniacid` int(10) unsigned NOT NULL,
	`token` varchar(32) NOT NULL,
	`access_token` varchar(1000) NOT NULL,
	`encodingaeskey` varchar(255) NOT NULL,
	`level` tinyint(4) unsigned NOT NULL,
	`name` varchar(30) NOT NULL,
	`account` varchar(30) NOT NULL,
	`original` varchar(50) NOT NULL,
	`signature` varchar(100) NOT NULL,
	`country` varchar(10) NOT NULL,
	`province` varchar(3) NOT NULL,
	`city` varchar(15) NOT NULL,
	`username` varchar(30) NOT NULL,
	`password` varchar(32) NOT NULL,
	`lastupdate` int(10) unsigned NOT NULL,
	`key` varchar(50) NOT NULL,
	`secret` varchar(50) NOT NULL,
	`styleid` int(10) unsigned NOT NULL,
	`subscribeurl` varchar(120) NOT NULL,
	`auth_refresh_token` varchar(255) NOT NULL,
	PRIMARY KEY (`acid`),
	KEY `idx_key` (`key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `ims_activity_clerks`
--

CREATE TABLE IF NOT EXISTS `ims_activity_clerks` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`storeid` int(10) unsigned NOT NULL,
	`name` varchar(50) NOT NULL,
	`password` varchar(50) NOT NULL,
	`mobile` varchar(20) NOT NULL,
	`openid` varchar(50) NOT NULL,
	`nickname` varchar(30) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `password` (`password`),
	KEY `openid` (`openid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_activity_clerk_menu`
--

CREATE TABLE IF NOT EXISTS `ims_activity_clerk_menu` (
	`id` int(11) NOT NULL AUTO_INCREMENT,
	`uniacid` int(11) NOT NULL,
	`displayorder` int(4) NOT NULL,
	`pid` int(6) NOT NULL,
	`group_name` varchar(20) NOT NULL,
	`title` varchar(20) NOT NULL,
	`icon` varchar(50) NOT NULL,
	`url` varchar(60) NOT NULL,
	`type` varchar(20) NOT NULL,
	`permission` varchar(50) NOT NULL,
	`system` int(2) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_activity_coupon_allocation`
--

CREATE TABLE IF NOT EXISTS `ims_activity_coupon_allocation` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`couponid` int(10) unsigned NOT NULL,
	`groupid` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`,`couponid`,`groupid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_activity_coupon_modules`
--

CREATE TABLE IF NOT EXISTS `ims_activity_coupon_modules` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`couponid` int(10) unsigned NOT NULL,
	`module` varchar(30) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `couponid` (`couponid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_activity_exchange`
--

CREATE TABLE IF NOT EXISTS `ims_activity_exchange` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(11) NOT NULL,
	`title` varchar(100) NOT NULL,
	`description` text NOT NULL,
	`thumb` varchar(500) NOT NULL,
	`type` tinyint(1) unsigned NOT NULL,
	`extra` varchar(3000) NOT NULL,
	`credit` int(10) unsigned NOT NULL,
	`credittype` varchar(10) NOT NULL,
	`pretotal` int(11) NOT NULL,
	`num` int(11) NOT NULL,
	`total` int(10) unsigned NOT NULL,
	`status` tinyint(3) unsigned NOT NULL,
	`starttime` int(10) unsigned NOT NULL,
	`endtime` int(10) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `extra` (`extra`(333))
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_activity_exchange_trades`
--

CREATE TABLE IF NOT EXISTS `ims_activity_exchange_trades` (
	`tid` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`exid` int(10) unsigned NOT NULL,
	`type` int(10) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`tid`),
	KEY `uniacid` (`uniacid`,`uid`,`exid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_activity_exchange_trades_shipping`
--

CREATE TABLE IF NOT EXISTS `ims_activity_exchange_trades_shipping` (
	`tid` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`exid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`status` tinyint(4) NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	`province` varchar(30) NOT NULL,
	`city` varchar(30) NOT NULL,
	`district` varchar(30) NOT NULL,
	`address` varchar(255) NOT NULL,
	`zipcode` varchar(6) NOT NULL,
	`mobile` varchar(30) NOT NULL,
	`name` varchar(30) NOT NULL,
	PRIMARY KEY (`tid`),
	KEY `uniacid` (`uniacid`),
	KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_activity_modules`
--

CREATE TABLE IF NOT EXISTS `ims_activity_modules` (
	`mid` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`exid` int(10) unsigned NOT NULL,
	`module` varchar(50) NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`available` int(10) unsigned NOT NULL,
	PRIMARY KEY (`mid`),
	KEY `uniacid` (`uniacid`),
	KEY `module` (`module`),
	KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_activity_modules_record`
--

CREATE TABLE IF NOT EXISTS `ims_activity_modules_record` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`mid` int(10) unsigned NOT NULL,
	`num` tinyint(3) NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `mid` (`mid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_activity_stores`
--

CREATE TABLE IF NOT EXISTS `ims_activity_stores` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`business_name` varchar(50) NOT NULL,
	`branch_name` varchar(50) NOT NULL,
	`category` varchar(255) NOT NULL,
	`province` varchar(15) NOT NULL,
	`city` varchar(15) NOT NULL,
	`district` varchar(15) NOT NULL,
	`address` varchar(50) NOT NULL,
	`longitude` varchar(15) NOT NULL,
	`latitude` varchar(15) NOT NULL,
	`telephone` varchar(20) NOT NULL,
	`photo_list` varchar(10000) NOT NULL,
	`avg_price` int(10) unsigned NOT NULL,
	`recommend` varchar(255) NOT NULL,
	`special` varchar(255) NOT NULL,
	`introduction` varchar(255) NOT NULL,
	`open_time` varchar(50) NOT NULL,
	`location_id` int(10) unsigned NOT NULL,
	`status` tinyint(3) unsigned NOT NULL,
	`source` tinyint(3) unsigned NOT NULL,
	`message` varchar(500) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `location_id` (`location_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_article_category`
--

CREATE TABLE IF NOT EXISTS `ims_article_category` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`title` varchar(30) NOT NULL,
	`displayorder` tinyint(3) unsigned NOT NULL,
	`type` varchar(15) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `type` (`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_article_news`
--

CREATE TABLE IF NOT EXISTS `ims_article_news` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`cateid` int(10) unsigned NOT NULL,
	`title` varchar(100) NOT NULL,
	`content` mediumtext NOT NULL,
	`thumb` varchar(255) NOT NULL,
	`source` varchar(255) NOT NULL,
	`author` varchar(50) NOT NULL,
	`displayorder` tinyint(3) unsigned NOT NULL,
	`is_display` tinyint(3) unsigned NOT NULL,
	`is_show_home` tinyint(3) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	`click` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `title` (`title`),
	KEY `cateid` (`cateid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_article_notice`
--

CREATE TABLE IF NOT EXISTS `ims_article_notice` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`cateid` int(10) unsigned NOT NULL,
	`title` varchar(100) NOT NULL,
	`content` mediumtext NOT NULL,
	`displayorder` tinyint(3) unsigned NOT NULL,
	`is_display` tinyint(3) unsigned NOT NULL,
	`is_show_home` tinyint(3) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	`click` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `title` (`title`),
	KEY `cateid` (`cateid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_article_unread_notice`
--

CREATE TABLE IF NOT EXISTS `ims_article_unread_notice` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`notice_id` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`is_new` tinyint(3) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uid` (`uid`),
	KEY `notice_id` (`notice_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_basic_reply`
--

CREATE TABLE IF NOT EXISTS `ims_basic_reply` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`rid` int(10) unsigned NOT NULL,
	`content` varchar(1000) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `rid` (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_business`
--

CREATE TABLE IF NOT EXISTS `ims_business` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`weid` int(10) unsigned NOT NULL,
	`title` varchar(50) NOT NULL,
	`thumb` varchar(255) NOT NULL,
	`content` varchar(1000) NOT NULL,
	`phone` varchar(15) NOT NULL,
	`qq` varchar(15) NOT NULL,
	`province` varchar(50) NOT NULL,
	`city` varchar(50) NOT NULL,
	`dist` varchar(50) NOT NULL,
	`address` varchar(500) NOT NULL,
	`lng` varchar(10) NOT NULL,
	`lat` varchar(10) NOT NULL,
	`industry1` varchar(10) NOT NULL,
	`industry2` varchar(10) NOT NULL,
	`createtime` int(10) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `idx_lat_lng` (`lng`,`lat`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_core_attachment`
--

CREATE TABLE IF NOT EXISTS `ims_core_attachment` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`filename` varchar(255) NOT NULL,
	`attachment` varchar(255) NOT NULL,
	`type` tinyint(3) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_core_cache`
--

CREATE TABLE IF NOT EXISTS `ims_core_cache` (
	`key` varchar(50) NOT NULL,
	`value` mediumtext NOT NULL,
	PRIMARY KEY (`key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `ims_core_cron`
--

CREATE TABLE IF NOT EXISTS `ims_core_cron` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`cloudid` int(10) unsigned NOT NULL,
	`module` varchar(50) NOT NULL,
	`uniacid` int(10) unsigned NOT NULL,
	`type` tinyint(3) unsigned NOT NULL,
	`name` varchar(50) NOT NULL,
	`filename` varchar(50) NOT NULL,
	`lastruntime` int(10) unsigned NOT NULL,
	`nextruntime` int(10) unsigned NOT NULL,
	`weekday` tinyint(3) NOT NULL,
	`day` tinyint(3) NOT NULL,
	`hour` tinyint(3) NOT NULL,
	`minute` varchar(255) NOT NULL,
	`extra` varchar(5000) NOT NULL,
	`status` tinyint(3) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `createtime` (`createtime`),
	KEY `nextruntime` (`nextruntime`),
	KEY `uniacid` (`uniacid`),
	KEY `cloudid` (`cloudid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_core_cron_record`
--

CREATE TABLE IF NOT EXISTS `ims_core_cron_record` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`module` varchar(50) NOT NULL,
	`type` varchar(50) NOT NULL,
	`tid` int(10) unsigned NOT NULL,
	`note` varchar(500) NOT NULL,
	`tag` varchar(5000) NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `tid` (`tid`),
	KEY `module` (`module`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_core_menu`
--

CREATE TABLE IF NOT EXISTS `ims_core_menu` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`pid` int(10) unsigned NOT NULL,
	`title` varchar(20) NOT NULL,
	`name` varchar(20) NOT NULL,
	`url` varchar(60) NOT NULL,
	`append_title` varchar(30) NOT NULL,
	`append_url` varchar(255) NOT NULL,
	`displayorder` tinyint(3) unsigned NOT NULL,
	`type` varchar(15) NOT NULL,
	`is_display` tinyint(3) unsigned NOT NULL,
	`is_system` tinyint(3) unsigned NOT NULL,
	`permission_name` varchar(50) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=90 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_core_paylog`
--

CREATE TABLE IF NOT EXISTS `ims_core_paylog` (
	`plid` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
	`type` varchar(20) NOT NULL,
	`uniacid` int(11) NOT NULL,
	`acid` int(10) NOT NULL,
	`openid` varchar(40) NOT NULL,
	`uniontid` varchar(64) NOT NULL,
	`tid` varchar(128) NOT NULL,
	`fee` decimal(10,2) NOT NULL,
	`status` tinyint(4) NOT NULL,
	`module` varchar(50) NOT NULL,
	`tag` varchar(2000) NOT NULL,
	`is_usecard` tinyint(3) unsigned NOT NULL,
	`card_type` tinyint(3) unsigned NOT NULL,
	`card_id` varchar(50) NOT NULL,
	`card_fee` decimal(10,2) unsigned NOT NULL,
	`encrypt_code` varchar(100) NOT NULL,
	PRIMARY KEY (`plid`),
	KEY `idx_openid` (`openid`),
	KEY `idx_tid` (`tid`),
	KEY `idx_uniacid` (`uniacid`),
	KEY `uniontid` (`uniontid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_core_performance`
--

CREATE TABLE IF NOT EXISTS `ims_core_performance` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`type` tinyint(1) NOT NULL,
	`runtime` varchar(10) NOT NULL,
	`runurl` varchar(512) NOT NULL,
	`runsql` varchar(512) NOT NULL,
	`createtime` int(10) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_core_queue`
--

CREATE TABLE IF NOT EXISTS `ims_core_queue` (
	`qid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`acid` int(10) unsigned NOT NULL,
	`message` varchar(2000) NOT NULL,
	`params` varchar(1000) NOT NULL,
	`keyword` varchar(1000) NOT NULL,
	`response` varchar(2000) NOT NULL,
	`module` varchar(50) NOT NULL,
	`type` tinyint(3) unsigned NOT NULL,
	`dateline` int(10) unsigned NOT NULL,
	PRIMARY KEY (`qid`),
	KEY `uniacid` (`uniacid`,`acid`),
	KEY `module` (`module`),
	KEY `dateline` (`dateline`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_core_resource`
--

CREATE TABLE IF NOT EXISTS `ims_core_resource` (
	`mid` int(11) NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`media_id` varchar(100) NOT NULL,
	`trunk` int(10) unsigned NOT NULL,
	`type` varchar(10) NOT NULL,
	`dateline` int(10) unsigned NOT NULL,
	PRIMARY KEY (`mid`),
	KEY `acid` (`uniacid`),
	KEY `type` (`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_core_sendsms_log`
--

CREATE TABLE IF NOT EXISTS `ims_core_sendsms_log` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`mobile` varchar(11) NOT NULL,
	`content` varchar(255) NOT NULL,
	`result` varchar(255) NOT NULL,
	`createtime` int(11) unsigned NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_core_sessions`
--

CREATE TABLE IF NOT EXISTS `ims_core_sessions` (
	`sid` char(32) NOT NULL,
	`uniacid` int(10) unsigned NOT NULL,
	`openid` varchar(50) NOT NULL,
	`data` varchar(5000) NOT NULL,
	`expiretime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`sid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `ims_core_settings`
--

CREATE TABLE IF NOT EXISTS `ims_core_settings` (
	`key` varchar(200) NOT NULL,
	`value` text NOT NULL,
	PRIMARY KEY (`key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `ims_coupon`
--

CREATE TABLE IF NOT EXISTS `ims_coupon` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`acid` int(10) unsigned NOT NULL,
	`card_id` varchar(50) NOT NULL,
	`type` varchar(15) NOT NULL,
	`logo_url` varchar(150) NOT NULL,
	`code_type` tinyint(3) unsigned NOT NULL,
	`brand_name` varchar(15) NOT NULL,
	`title` varchar(15) NOT NULL,
	`sub_title` varchar(20) NOT NULL,
	`color` varchar(15) NOT NULL,
	`notice` varchar(15) NOT NULL,
	`description` varchar(1000) NOT NULL,
	`date_info` varchar(200) NOT NULL,
	`quantity` int(10) unsigned NOT NULL,
	`use_custom_code` tinyint(3) NOT NULL,
	`bind_openid` tinyint(3) unsigned NOT NULL,
	`can_share` tinyint(3) unsigned NOT NULL,
	`can_give_friend` tinyint(3) unsigned NOT NULL,
	`get_limit` tinyint(3) unsigned NOT NULL,
	`service_phone` varchar(20) NOT NULL,
	`extra` varchar(1000) NOT NULL,
	`status` tinyint(3) unsigned NOT NULL,
	`is_display` tinyint(3) unsigned NOT NULL,
	`is_selfconsume` tinyint(3) unsigned NOT NULL,
	`promotion_url_name` varchar(10) NOT NULL,
	`promotion_url` varchar(100) NOT NULL,
	`promotion_url_sub_title` varchar(10) NOT NULL,
	`source` tinyint(3) unsigned NOT NULL,
	`dosage` int(10) unsigned DEFAULT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`,`acid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_coupon_activity`
--

CREATE TABLE IF NOT EXISTS `ims_coupon_activity` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) NOT NULL,
	`msg_id` int(10) NOT NULL,
	`status` int(10) NOT NULL,
	`title` varchar(255) NOT NULL,
	`type` int(3) NOT NULL,
	`thumb` varchar(255) NOT NULL,
	`coupons` varchar(255) NOT NULL,
	`description` varchar(255) NOT NULL,
	`members` varchar(255) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_coupon_groups`
--

CREATE TABLE IF NOT EXISTS `ims_coupon_groups` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) NOT NULL,
	`couponid` varchar(255) NOT NULL,
	`groupid` int(10) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_coupon_location`
--

CREATE TABLE IF NOT EXISTS `ims_coupon_location` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`acid` int(10) unsigned NOT NULL,
	`sid` int(10) unsigned NOT NULL,
	`location_id` int(10) unsigned NOT NULL,
	`business_name` varchar(50) NOT NULL,
	`branch_name` varchar(50) NOT NULL,
	`category` varchar(255) NOT NULL,
	`province` varchar(15) NOT NULL,
	`city` varchar(15) NOT NULL,
	`district` varchar(15) NOT NULL,
	`address` varchar(50) NOT NULL,
	`longitude` varchar(15) NOT NULL,
	`latitude` varchar(15) NOT NULL,
	`telephone` varchar(20) NOT NULL,
	`photo_list` varchar(10000) NOT NULL,
	`avg_price` int(10) unsigned NOT NULL,
	`open_time` varchar(50) NOT NULL,
	`recommend` varchar(255) NOT NULL,
	`special` varchar(255) NOT NULL,
	`introduction` varchar(255) NOT NULL,
	`offset_type` tinyint(3) unsigned NOT NULL,
	`status` tinyint(3) unsigned NOT NULL,
	`message` varchar(255) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`,`acid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_coupon_modules`
--

CREATE TABLE IF NOT EXISTS `ims_coupon_modules` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`acid` int(10) unsigned NOT NULL,
	`couponid` int(10) unsigned NOT NULL,
	`module` varchar(30) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`,`acid`),
	KEY `couponid` (`couponid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_coupon_record`
--

CREATE TABLE IF NOT EXISTS `ims_coupon_record` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`acid` int(10) unsigned NOT NULL,
	`card_id` varchar(50) NOT NULL,
	`openid` varchar(50) NOT NULL,
	`friend_openid` varchar(50) NOT NULL,
	`givebyfriend` tinyint(3) unsigned NOT NULL,
	`code` varchar(50) NOT NULL,
	`hash` varchar(32) NOT NULL,
	`addtime` int(10) unsigned NOT NULL,
	`usetime` int(10) unsigned NOT NULL,
	`status` tinyint(3) NOT NULL,
	`clerk_name` varchar(15) NOT NULL,
	`clerk_id` int(10) unsigned NOT NULL,
	`store_id` int(10) unsigned NOT NULL,
	`clerk_type` tinyint(3) unsigned NOT NULL,
	`couponid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`grantmodule` varchar(255) NOT NULL,
	`remark` varchar(255) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`,`acid`),
	KEY `card_id` (`card_id`),
	KEY `hash` (`hash`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_coupon_store`
--

CREATE TABLE IF NOT EXISTS `ims_coupon_store` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) NOT NULL,
	`couponid` varchar(255) NOT NULL,
	`storeid` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `couponid` (`couponid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_cover_reply`
--

CREATE TABLE IF NOT EXISTS `ims_cover_reply` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`multiid` int(10) unsigned NOT NULL,
	`rid` int(10) unsigned NOT NULL,
	`module` varchar(30) NOT NULL,
	`do` varchar(30) NOT NULL,
	`title` varchar(255) NOT NULL,
	`description` varchar(255) NOT NULL,
	`thumb` varchar(255) NOT NULL,
	`url` varchar(255) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `rid` (`rid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_custom_reply`
--

CREATE TABLE IF NOT EXISTS `ims_custom_reply` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`rid` int(10) unsigned NOT NULL,
	`start1` int(10) NOT NULL,
	`end1` int(10) NOT NULL,
	`start2` int(10) NOT NULL,
	`end2` int(10) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `rid` (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_images_reply`
--

CREATE TABLE IF NOT EXISTS `ims_images_reply` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`rid` int(10) unsigned NOT NULL,
	`title` varchar(50) NOT NULL,
	`description` varchar(255) NOT NULL,
	`mediaid` varchar(255) NOT NULL,
	`createtime` int(10) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `rid` (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_card`
--

CREATE TABLE IF NOT EXISTS `ims_mc_card` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`title` varchar(100) NOT NULL,
	`color` varchar(255) NOT NULL,
	`background` varchar(255) NOT NULL,
	`logo` varchar(255) NOT NULL,
	`format_type` tinyint(3) unsigned NOT NULL,
	`format` varchar(50) NOT NULL,
	`description` varchar(512) NOT NULL,
	`fields` varchar(1000) NOT NULL,
	`snpos` int(11) NOT NULL,
	`status` tinyint(1) NOT NULL,
	`business` text NOT NULL,
	`discount_type` tinyint(3) unsigned NOT NULL,
	`discount` varchar(3000) NOT NULL,
	`grant` varchar(3000) NOT NULL,
	`grant_rate` varchar(20) NOT NULL,
	`offset_rate` int(10) unsigned NOT NULL,
	`offset_max` int(10) NOT NULL,
	`nums_status` tinyint(3) unsigned NOT NULL,
	`nums_text` varchar(15) NOT NULL,
	`nums` varchar(1000) NOT NULL,
	`times_status` tinyint(3) unsigned NOT NULL,
	`times_text` varchar(15) NOT NULL,
	`times` varchar(1000) NOT NULL,
	`params` longtext NOT NULL,
	`html` longtext NOT NULL,
	`recommend_status` tinyint(3) unsigned NOT NULL,
	`sign_status` tinyint(3) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_card_care`
--

CREATE TABLE IF NOT EXISTS `ims_mc_card_care` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`title` varchar(30) NOT NULL,
	`type` tinyint(3) unsigned NOT NULL,
	`groupid` int(10) unsigned NOT NULL,
	`credit1` int(10) unsigned NOT NULL,
	`credit2` int(10) unsigned NOT NULL,
	`couponid` int(10) unsigned NOT NULL,
	`granttime` int(10) unsigned NOT NULL,
	`days` int(10) unsigned NOT NULL,
	`time` tinyint(3) unsigned NOT NULL,
	`show_in_card` tinyint(3) unsigned NOT NULL,
	`content` varchar(1000) NOT NULL,
	`sms_notice` tinyint(3) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_card_credit_set`
--

CREATE TABLE IF NOT EXISTS `ims_mc_card_credit_set` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`sign` varchar(1000) NOT NULL,
	`share` varchar(500) NOT NULL,
	`content` text NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_card_members`
--

CREATE TABLE IF NOT EXISTS `ims_mc_card_members` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`uid` int(10) DEFAULT NULL,
	`openid` varchar(50) NOT NULL,
	`cid` int(10) NOT NULL,
	`cardsn` varchar(20) NOT NULL,
	`status` tinyint(1) NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	`nums` int(10) unsigned NOT NULL,
	`endtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_card_notices`
--

CREATE TABLE IF NOT EXISTS `ims_mc_card_notices` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`type` tinyint(3) unsigned NOT NULL,
	`title` varchar(30) NOT NULL,
	`thumb` varchar(100) NOT NULL,
	`groupid` int(10) unsigned NOT NULL,
	`content` text NOT NULL,
	`addtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_card_notices_unread`
--

CREATE TABLE IF NOT EXISTS `ims_mc_card_notices_unread` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`notice_id` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`is_new` tinyint(3) unsigned NOT NULL,
	`type` tinyint(3) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `uid` (`uid`),
	KEY `notice_id` (`notice_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_card_recommend`
--

CREATE TABLE IF NOT EXISTS `ims_mc_card_recommend` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`title` varchar(30) NOT NULL,
	`thumb` varchar(100) NOT NULL,
	`url` varchar(100) NOT NULL,
	`displayorder` tinyint(3) unsigned NOT NULL,
	`addtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_card_record`
--

CREATE TABLE IF NOT EXISTS `ims_mc_card_record` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`type` varchar(15) NOT NULL,
	`model` tinyint(3) unsigned NOT NULL,
	`fee` decimal(10,2) unsigned NOT NULL,
	`tag` varchar(10) NOT NULL,
	`note` varchar(255) NOT NULL,
	`remark` varchar(200) NOT NULL,
	`addtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `uid` (`uid`),
	KEY `addtime` (`addtime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_card_sign_record`
--

CREATE TABLE IF NOT EXISTS `ims_mc_card_sign_record` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`credit` int(10) unsigned NOT NULL,
	`is_grant` tinyint(3) unsigned NOT NULL,
	`addtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_cash_record`
--

CREATE TABLE IF NOT EXISTS `ims_mc_cash_record` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`clerk_id` int(10) unsigned NOT NULL,
	`store_id` int(10) unsigned NOT NULL,
	`clerk_type` tinyint(3) unsigned NOT NULL,
	`fee` decimal(10,2) unsigned NOT NULL,
	`final_fee` decimal(10,2) unsigned NOT NULL,
	`credit1` int(10) unsigned NOT NULL,
	`credit1_fee` decimal(10,2) unsigned NOT NULL,
	`credit2` decimal(10,2) unsigned NOT NULL,
	`cash` decimal(10,2) unsigned NOT NULL,
	`return_cash` decimal(10,2) unsigned NOT NULL,
	`final_cash` decimal(10,2) unsigned NOT NULL,
	`remark` varchar(255) NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_chats_record`
--

CREATE TABLE IF NOT EXISTS `ims_mc_chats_record` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`acid` int(10) unsigned NOT NULL,
	`flag` tinyint(3) unsigned NOT NULL,
	`openid` varchar(32) NOT NULL,
	`msgtype` varchar(15) NOT NULL,
	`content` varchar(10000) NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`,`acid`),
	KEY `openid` (`openid`),
	KEY `createtime` (`createtime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_credits_recharge`
--

CREATE TABLE IF NOT EXISTS `ims_mc_credits_recharge` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`openid` varchar(50) NOT NULL,
	`tid` varchar(64) NOT NULL,
	`transid` varchar(30) NOT NULL,
	`fee` varchar(10) NOT NULL,
	`type` varchar(15) NOT NULL,
	`tag` varchar(10) NOT NULL,
	`status` tinyint(1) NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	`backtype` tinyint(3) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `idx_uniacid_uid` (`uniacid`,`uid`),
	KEY `idx_tid` (`tid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_credits_record`
--

CREATE TABLE IF NOT EXISTS `ims_mc_credits_record` (
	`id` int(11) NOT NULL AUTO_INCREMENT,
	`uid` int(10) unsigned NOT NULL,
	`uniacid` int(11) NOT NULL,
	`credittype` varchar(10) NOT NULL,
	`num` decimal(10,2) NOT NULL,
	`operator` int(10) unsigned NOT NULL,
	`module` varchar(30) NOT NULL,
	`clerk_id` int(10) unsigned NOT NULL,
	`store_id` int(10) unsigned NOT NULL,
	`clerk_type` tinyint(3) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	`remark` varchar(200) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_fans_groups`
--

CREATE TABLE IF NOT EXISTS `ims_mc_fans_groups` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`acid` int(10) unsigned NOT NULL,
	`groups` varchar(10000) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_fans_tag_mapping`
--

CREATE TABLE IF NOT EXISTS `ims_mc_fans_tag_mapping` (
	`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
	`fanid` int(11) unsigned NOT NULL,
	`tagid` tinyint(3) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	UNIQUE KEY `mapping` (`fanid`,`tagid`),
	KEY `fanid_index` (`fanid`),
	KEY `tagid_index` (`tagid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_groups`
--

CREATE TABLE IF NOT EXISTS `ims_mc_groups` (
	`groupid` int(11) NOT NULL AUTO_INCREMENT,
	`uniacid` int(11) NOT NULL,
	`title` varchar(20) NOT NULL,
	`credit` int(10) unsigned NOT NULL,
	`isdefault` tinyint(4) NOT NULL,
	PRIMARY KEY (`groupid`),
	KEY `uniacid` (`uniacid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_handsel`
--

CREATE TABLE IF NOT EXISTS `ims_mc_handsel` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) NOT NULL,
	`touid` int(10) unsigned NOT NULL,
	`fromuid` varchar(32) NOT NULL,
	`module` varchar(30) NOT NULL,
	`sign` varchar(100) NOT NULL,
	`action` varchar(20) NOT NULL,
	`credit_value` int(10) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uid` (`touid`),
	KEY `uniacid` (`uniacid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE IF NOT EXISTS `ims_mc_mapping_fans` (
	`fanid`     int(10) unsigned NOT NULL AUTO_INCREMENT    COMMENT 'id',
	`acid`      int(10) unsigned NOT NULL    	COMMENT 'uniacid是一组公众号的统一id，acid是下面每一个公众号的唯一id',
	`uniacid`   int(10) unsigned NOT NULL    	COMMENT '举个例子：某商场有一个订阅号用于消息推送，一个服务号用于O2O下单'
	`uid`       int(10) unsigned NOT NULL    	COMMENT '统一用户uid',
	`openid`    varchar(50) NOT NULL    		COMMENT 'openid',
	`nickname`  varchar(50) NOT NULL    		COMMENT '微信昵称',
	`groupid`   varchar(30) NOT NULL    		COMMENT '',
	`salt`      char(8) NOT NULL,
	`follow`    tinyint(1) unsigned NOT NULL,
	`followtime` int(10) unsigned NOT NULL,
	`unfollowtime` int(10) unsigned NOT NULL,
	`tag`       varchar(1000) NOT NULL,
	`updatetime` int(10) unsigned DEFAULT NULL,
	`unionid`   varchar(64) NOT NULL,
	PRIMARY KEY (`fanid`),
	UNIQUE KEY `openid` (`openid`),
	KEY `acid` (`acid`),
	KEY `uniacid` (`uniacid`),
	KEY `nickname` (`nickname`),
	KEY `updatetime` (`updatetime`),
	KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1  COMMENT '关注公众号粉丝表',

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_mapping_ucenter`
--

CREATE TABLE IF NOT EXISTS `ims_mc_mapping_ucenter` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`centeruid` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE IF NOT EXISTS `ims_mc_mass_record` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`acid` int(10) unsigned NOT NULL,
	`groupname` varchar(50) NOT NULL,
	`fansnum` int(10) unsigned NOT NULL,
	`msgtype` varchar(10) NOT NULL,
	`content` varchar(10000) NOT NULL,
	`group` int(10) NOT NULL,
	`attach_id` int(10) unsigned NOT NULL,
	`media_id` varchar(100) NOT NULL,
	`type` tinyint(3) unsigned NOT NULL,
	`status` tinyint(3) unsigned NOT NULL,
	`cron_id` int(10) unsigned NOT NULL,
	`sendtime` int(10) unsigned NOT NULL,
	`finalsendtime` int(10) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`,`acid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------


CREATE TABLE IF NOT EXISTS `ims_mc_members` (
	`uid` int(10) unsigned NOT NULL AUTO_INCREMENT   	COMMENT '统一用户uid',
	`uniacid` int(10) unsigned NOT NULL,
	`mobile` varchar(11) NOT NULL,
	`email` varchar(50) NOT NULL,
	`password` varchar(32) NOT NULL,
	`salt` varchar(8) NOT NULL,
	`groupid` int(11) NOT NULL,
	`credit1` decimal(10,2) unsigned NOT NULL,
	`credit2` decimal(10,2) unsigned NOT NULL,
	`credit3` decimal(10,2) unsigned NOT NULL,
	`credit4` decimal(10,2) unsigned NOT NULL,
	`credit5` decimal(10,2) unsigned NOT NULL,
	`credit6` decimal(10,2) NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	`realname` varchar(10) NOT NULL,
	`nickname` varchar(20) NOT NULL,
	`avatar` varchar(255) NOT NULL,
	`qq` varchar(15) NOT NULL,
	`vip` tinyint(3) unsigned NOT NULL,
	`gender` tinyint(1) NOT NULL,
	`birthyear` smallint(6) unsigned NOT NULL,
	`birthmonth` tinyint(3) unsigned NOT NULL,
	`birthday` tinyint(3) unsigned NOT NULL,
	`constellation` varchar(10) NOT NULL,
	`zodiac` varchar(5) NOT NULL,
	`telephone` varchar(15) NOT NULL,
	`idcard` varchar(30) NOT NULL,
	`studentid` varchar(50) NOT NULL,
	`grade` varchar(10) NOT NULL,
	`address` varchar(255) NOT NULL,
	`zipcode` varchar(10) NOT NULL,
	`nationality` varchar(30) NOT NULL,
	`resideprovince` varchar(30) NOT NULL,
	`residecity` varchar(30) NOT NULL,
	`residedist` varchar(30) NOT NULL,
	`graduateschool` varchar(50) NOT NULL,
	`company` varchar(50) NOT NULL,
	`education` varchar(10) NOT NULL,
	`occupation` varchar(30) NOT NULL,
	`position` varchar(30) NOT NULL,
	`revenue` varchar(10) NOT NULL,
	`affectivestatus` varchar(30) NOT NULL,
	`lookingfor` varchar(255) NOT NULL,
	`bloodtype` varchar(5) NOT NULL,
	`height` varchar(5) NOT NULL,
	`weight` varchar(5) NOT NULL,
	`alipay` varchar(30) NOT NULL,
	`msn` varchar(30) NOT NULL,
	`taobao` varchar(30) NOT NULL,
	`site` varchar(30) NOT NULL,
	`bio` text NOT NULL,
	`interest` text NOT NULL,
	PRIMARY KEY (`uid`),
	KEY `groupid` (`groupid`),
	KEY `uniacid` (`uniacid`),
	KEY `email` (`email`),
	KEY `mobile` (`mobile`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1  COMMENT '统一用户表，针对所有公众号',


CREATE TABLE IF NOT EXISTS `ims_mc_member_address` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`uid` int(50) unsigned NOT NULL,
	`username` varchar(20) NOT NULL,
	`mobile` varchar(11) NOT NULL,
	`zipcode` varchar(6) NOT NULL,
	`province` varchar(32) NOT NULL,
	`city` varchar(32) NOT NULL,
	`district` varchar(32) NOT NULL,
	`address` varchar(512) NOT NULL,
	`isdefault` tinyint(1) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `idx_uinacid` (`uniacid`),
	KEY `idx_uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_member_fields`
--

CREATE TABLE IF NOT EXISTS `ims_mc_member_fields` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) NOT NULL,
	`fieldid` int(10) NOT NULL,
	`title` varchar(255) NOT NULL,
	`available` tinyint(1) NOT NULL,
	`displayorder` smallint(6) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `idx_uniacid` (`uniacid`),
	KEY `idx_fieldid` (`fieldid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=37 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mc_oauth_fans`
--

CREATE TABLE IF NOT EXISTS `ims_mc_oauth_fans` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`oauth_openid` varchar(50) NOT NULL,
	`acid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`openid` varchar(50) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `idx_oauthopenid_acid` (`oauth_openid`,`acid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_menu_event`
--

CREATE TABLE IF NOT EXISTS `ims_menu_event` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`keyword` varchar(30) NOT NULL,
	`type` varchar(30) NOT NULL,
	`picmd5` varchar(32) NOT NULL,
	`openid` varchar(128) NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `picmd5` (`picmd5`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_mobilenumber`
--

CREATE TABLE IF NOT EXISTS `ims_mobilenumber` (
	`id` int(11) NOT NULL AUTO_INCREMENT,
	`rid` int(10) NOT NULL,
	`enabled` tinyint(1) unsigned NOT NULL,
	`dateline` int(11) DEFAULT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_modules`
--

CREATE TABLE IF NOT EXISTS `ims_modules` (
	`mid` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`name` varchar(100) NOT NULL,
	`type` varchar(20) NOT NULL,
	`title` varchar(100) NOT NULL,
	`version` varchar(10) NOT NULL,
	`ability` varchar(500) NOT NULL,
	`description` varchar(1000) NOT NULL,
	`author` varchar(50) NOT NULL,
	`url` varchar(255) NOT NULL,
	`settings` tinyint(1) NOT NULL,
	`subscribes` varchar(500) NOT NULL,
	`handles` varchar(500) NOT NULL,
	`isrulefields` tinyint(1) NOT NULL,
	`issystem` tinyint(1) unsigned NOT NULL,
	`target` int(10) unsigned NOT NULL,
	`iscard` tinyint(3) unsigned NOT NULL,
	`permissions` varchar(5000) NOT NULL,
	PRIMARY KEY (`mid`),
	KEY `idx_name` (`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_modules_bindings`
--

CREATE TABLE IF NOT EXISTS `ims_modules_bindings` (
	`eid` int(11) NOT NULL AUTO_INCREMENT,
	`module` varchar(30) NOT NULL,
	`entry` varchar(10) NOT NULL,
	`call` varchar(50) NOT NULL,
	`title` varchar(50) NOT NULL,
	`do` varchar(30) NOT NULL,
	`state` varchar(200) NOT NULL,
	`direct` int(11) NOT NULL,
	`url` varchar(100) NOT NULL,
	`icon` varchar(50) NOT NULL,
	`displayorder` tinyint(255) unsigned NOT NULL,
	PRIMARY KEY (`eid`),
	KEY `idx_module` (`module`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_modules_recycle`
--

CREATE TABLE IF NOT EXISTS `ims_modules_recycle` (
	`id` int(10) NOT NULL AUTO_INCREMENT,
	`modulename` varchar(255) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `modulename` (`modulename`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_music_reply`
--

CREATE TABLE IF NOT EXISTS `ims_music_reply` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`rid` int(10) unsigned NOT NULL,
	`title` varchar(50) NOT NULL,
	`description` varchar(255) NOT NULL,
	`url` varchar(300) NOT NULL,
	`hqurl` varchar(300) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `rid` (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_news_reply`
--

CREATE TABLE IF NOT EXISTS `ims_news_reply` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`rid` int(10) unsigned NOT NULL,
	`parent_id` int(10) NOT NULL,
	`title` varchar(50) NOT NULL,
	`author` varchar(64) NOT NULL,
	`description` varchar(255) NOT NULL,
	`thumb` varchar(255) NOT NULL,
	`content` mediumtext NOT NULL,
	`url` varchar(255) NOT NULL,
	`displayorder` int(10) NOT NULL,
	`incontent` tinyint(1) NOT NULL,
	`createtime` int(10) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `rid` (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_paycenter_order`
--

CREATE TABLE IF NOT EXISTS `ims_paycenter_order` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`pid` int(10) unsigned NOT NULL,
	`clerk_id` int(10) unsigned NOT NULL,
	`store_id` int(10) unsigned NOT NULL,
	`clerk_type` tinyint(3) unsigned NOT NULL,
	`uniontid` varchar(40) NOT NULL,
	`transaction_id` varchar(40) NOT NULL,
	`type` varchar(10) NOT NULL,
	`trade_type` varchar(10) NOT NULL,
	`body` varchar(255) NOT NULL,
	`fee` varchar(15) NOT NULL,
	`final_fee` decimal(10,2) unsigned NOT NULL,
	`credit1` int(10) unsigned NOT NULL,
	`credit1_fee` decimal(10,2) unsigned NOT NULL,
	`credit2` decimal(10,2) unsigned NOT NULL,
	`cash` decimal(10,2) unsigned NOT NULL,
	`remark` varchar(255) NOT NULL,
	`auth_code` varchar(30) NOT NULL,
	`openid` varchar(50) NOT NULL,
	`nickname` varchar(50) NOT NULL,
	`follow` tinyint(3) unsigned NOT NULL,
	`status` tinyint(3) unsigned NOT NULL,
	`credit_status` tinyint(3) unsigned NOT NULL,
	`paytime` int(10) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_profile_fields`
--

CREATE TABLE IF NOT EXISTS `ims_profile_fields` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`field` varchar(255) NOT NULL,
	`available` tinyint(1) NOT NULL,
	`title` varchar(255) NOT NULL,
	`description` varchar(255) NOT NULL,
	`displayorder` smallint(6) NOT NULL,
	`required` tinyint(1) NOT NULL,
	`unchangeable` tinyint(1) NOT NULL,
	`showinregister` tinyint(1) NOT NULL,
	`field_length` int(10) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=37 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_qrcode`
--

CREATE TABLE IF NOT EXISTS `ims_qrcode` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL			COMMENT '统一公众号',
	`acid` int(10) unsigned NOT NULL			COMMENT '子公众号',
	`type` varchar(10) NOT NULL					COMMENT '临时与永久都为scene  不清楚',
	`extra` int(10) unsigned NOT NULL			COMMENT '临时与永久都为0  不清楚',
	`qrcid` bigint(20) NOT NULL					COMMENT '临时的 场景ID',
	`scene_str` varchar(64) NOT NULL			COMMENT '永久的 场景字符串',
	`name` varchar(50) NOT NULL					COMMENT '场景名称',
	`keyword` varchar(100) NOT NULL				COMMENT '绑定处理关键字',
	`model` tinyint(1) unsigned NOT NULL		COMMENT '临时1 永久2',
	`ticket` varchar(250) NOT NULL				COMMENT 'ticket  取二维码用',
	`url` varchar(256) NOT NULL					COMMENT '不清楚',
	`expire` int(10) unsigned NOT NULL			COMMENT '临时二维码过期时间, 最大为30天（2592000秒）.',
	`subnum` int(10) unsigned NOT NULL			COMMENT '不清楚',
	`createtime` int(10) unsigned NOT NULL		COMMENT '生成时间',
	`status` tinyint(1) unsigned NOT NULL		COMMENT '1生效',
	PRIMARY KEY (`id`),
	KEY `idx_qrcid` (`qrcid`),
	KEY `uniacid` (`uniacid`),
	KEY `ticket` (`ticket`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 COMMENT '二维码';

-- --------------------------------------------------------

--
-- 表的结构 `ims_qrcode_stat`
--

CREATE TABLE IF NOT EXISTS `ims_qrcode_stat` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL			COMMENT '统一公众号',
	`acid` int(10) unsigned NOT NULL			COMMENT '子公众号',
	`qid` int(10) unsigned NOT NULL				COMMENT 'ims_qrcode id',
	`openid` varchar(50) NOT NULL				COMMENT '扫码者',
	`type` tinyint(1) unsigned NOT NULL			COMMENT '1关注  2扫描',
	`qrcid` bigint(20) unsigned NOT NULL		COMMENT '临时的 场景ID',
	`scene_str` varchar(64) NOT NULL			COMMENT '永久的 场景字符串',
	`name` varchar(50) NOT NULL					COMMENT '场景名称',
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 COMMENT '二维码扫描记录';

-- --------------------------------------------------------

--
-- 表的结构 `ims_rule`
--

CREATE TABLE IF NOT EXISTS `ims_rule` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL  			COMMENT '统一公众号',
	`name` varchar(50) NOT NULL  					COMMENT '规则名',
	`module` varchar(50) NOT NULL 					COMMENT '对应模型',
	`displayorder` int(10) unsigned NOT NULL,
	`status` tinyint(1) unsigned NOT NULL 			COMMENT '1开启',
	PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1  			COMMENT '回复规则';

-- --------------------------------------------------------

--
-- 表的结构 `ims_rule_keyword`
--

CREATE TABLE IF NOT EXISTS `ims_rule_keyword` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`rid` int(10) unsigned NOT NULL  				COMMENT '回复规则id',
	`uniacid` int(10) unsigned NOT NULL  			COMMENT '统一公众号',
	`module` varchar(50) NOT NULL  					COMMENT '对应模型',
	`content` varchar(255) NOT NULL  				COMMENT '关键字  可以为正则',
	`type` tinyint(1) unsigned NOT NULL  			COMMENT '1应当为普通关键字 2包含关键字 3为正则 4直接接管',
	`displayorder` tinyint(3) unsigned NOT NULL,
	`status` tinyint(1) unsigned NOT NULL  			COMMENT '1开启',
	PRIMARY KEY (`id`),
	KEY `idx_content` (`content`),
	KEY `idx_rid` (`rid`),
	KEY `idx_uniacid_type_content` (`uniacid`,`type`,`content`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1  			COMMENT '回复规则的触发关键字';

-- --------------------------------------------------------

--
-- 表的结构 `ims_site_article`
--

CREATE TABLE IF NOT EXISTS `ims_site_article` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`rid` int(10) unsigned NOT NULL,
	`kid` int(10) unsigned NOT NULL,
	`iscommend` tinyint(1) NOT NULL,
	`ishot` tinyint(1) unsigned NOT NULL,
	`pcate` int(10) unsigned NOT NULL,
	`ccate` int(10) unsigned NOT NULL,
	`template` varchar(300) NOT NULL,
	`title` varchar(100) NOT NULL,
	`description` varchar(100) NOT NULL,
	`content` mediumtext NOT NULL,
	`thumb` varchar(255) NOT NULL,
	`incontent` tinyint(1) NOT NULL,
	`source` varchar(255) NOT NULL,
	`author` varchar(50) NOT NULL,
	`displayorder` int(10) unsigned NOT NULL,
	`linkurl` varchar(500) NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	`click` int(10) unsigned NOT NULL,
	`type` varchar(10) NOT NULL,
	`credit` varchar(255) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `idx_iscommend` (`iscommend`),
	KEY `idx_ishot` (`ishot`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_site_category`
--

CREATE TABLE IF NOT EXISTS `ims_site_category` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`nid` int(10) unsigned NOT NULL,
	`name` varchar(50) NOT NULL,
	`parentid` int(10) unsigned NOT NULL,
	`displayorder` tinyint(3) unsigned NOT NULL,
	`enabled` tinyint(1) unsigned NOT NULL,
	`icon` varchar(100) NOT NULL,
	`description` varchar(100) NOT NULL,
	`styleid` int(10) unsigned NOT NULL,
	`linkurl` varchar(500) NOT NULL,
	`ishomepage` tinyint(1) NOT NULL,
	`icontype` tinyint(1) unsigned NOT NULL,
	`css` varchar(500) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_site_multi`
--

CREATE TABLE IF NOT EXISTS `ims_site_multi` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`title` varchar(30) NOT NULL,
	`styleid` int(10) unsigned NOT NULL,
	`site_info` text NOT NULL,
	`status` tinyint(3) unsigned NOT NULL,
	`bindhost` varchar(255) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `bindhost` (`bindhost`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_site_nav`
--

CREATE TABLE IF NOT EXISTS `ims_site_nav` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`multiid` int(10) unsigned NOT NULL,
	`section` tinyint(4) NOT NULL,
	`module` varchar(50) NOT NULL,
	`displayorder` smallint(5) unsigned NOT NULL,
	`name` varchar(50) NOT NULL,
	`description` varchar(1000) NOT NULL,
	`position` tinyint(4) NOT NULL,
	`url` varchar(255) NOT NULL,
	`icon` varchar(500) NOT NULL,
	`css` varchar(1000) NOT NULL,
	`status` tinyint(1) unsigned NOT NULL,
	`categoryid` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `multiid` (`multiid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_site_page`
--

CREATE TABLE IF NOT EXISTS `ims_site_page` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`multiid` int(10) unsigned NOT NULL,
	`title` varchar(50) NOT NULL,
	`description` varchar(255) NOT NULL,
	`params` longtext NOT NULL,
	`html` longtext NOT NULL,
	`multipage` longtext NOT NULL,
	`type` tinyint(1) unsigned NOT NULL,
	`status` tinyint(1) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	`goodnum` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `multiid` (`multiid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_site_slide`
--

CREATE TABLE IF NOT EXISTS `ims_site_slide` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`multiid` int(10) unsigned NOT NULL,
	`title` varchar(255) NOT NULL,
	`url` varchar(255) NOT NULL,
	`thumb` varchar(255) NOT NULL,
	`displayorder` tinyint(4) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `multiid` (`multiid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_site_styles`
--

CREATE TABLE IF NOT EXISTS `ims_site_styles` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`templateid` int(10) unsigned NOT NULL,
	`name` varchar(50) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_site_styles_vars`
--

CREATE TABLE IF NOT EXISTS `ims_site_styles_vars` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`templateid` int(10) unsigned NOT NULL,
	`styleid` int(10) unsigned NOT NULL,
	`variable` varchar(50) NOT NULL,
	`content` text NOT NULL,
	`description` varchar(50) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_site_templates`
--

CREATE TABLE IF NOT EXISTS `ims_site_templates` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`name` varchar(30) NOT NULL,
	`title` varchar(30) NOT NULL,
	`version` varchar(64) NOT NULL,
	`description` varchar(500) NOT NULL,
	`author` varchar(50) NOT NULL,
	`url` varchar(255) NOT NULL,
	`type` varchar(20) NOT NULL,
	`sections` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_stat_fans`
--

CREATE TABLE IF NOT EXISTS `ims_stat_fans` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`new` int(10) unsigned NOT NULL,
	`cancel` int(10) unsigned NOT NULL,
	`cumulate` int(10) NOT NULL,
	`date` varchar(8) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`,`date`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_stat_keyword`
--

CREATE TABLE IF NOT EXISTS `ims_stat_keyword` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`rid` varchar(10) NOT NULL,
	`kid` int(10) unsigned NOT NULL,
	`hit` int(10) unsigned NOT NULL,
	`lastupdate` int(10) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `idx_createtime` (`createtime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_stat_msg_history`
--

CREATE TABLE IF NOT EXISTS `ims_stat_msg_history` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`rid` int(10) unsigned NOT NULL,
	`kid` int(10) unsigned NOT NULL,
	`from_user` varchar(50) NOT NULL,
	`module` varchar(50) NOT NULL,
	`message` varchar(1000) NOT NULL,
	`type` varchar(10) NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `idx_createtime` (`createtime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_stat_rule`
--

CREATE TABLE IF NOT EXISTS `ims_stat_rule` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`rid` int(10) unsigned NOT NULL,
	`hit` int(10) unsigned NOT NULL,
	`lastupdate` int(10) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `idx_createtime` (`createtime`),
	KEY `rid` (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_uni_account`
--

CREATE TABLE IF NOT EXISTS `ims_uni_account` (
	`uniacid` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`groupid` int(10) NOT NULL,
	`name` varchar(100) NOT NULL,
	`description` varchar(255) NOT NULL,
	`default_acid` int(10) unsigned NOT NULL,
	`rank` tinyint(1) DEFAULT NULL,
	PRIMARY KEY (`uniacid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_uni_account_group`
--

CREATE TABLE IF NOT EXISTS `ims_uni_account_group` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`groupid` int(10) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_uni_account_menus`
--

CREATE TABLE IF NOT EXISTS `ims_uni_account_menus` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`menuid` int(10) unsigned NOT NULL,
	`type` tinyint(3) unsigned NOT NULL,
	`title` varchar(30) NOT NULL,
	`sex` tinyint(3) unsigned NOT NULL,
	`group_id` int(10) NOT NULL,
	`client_platform_type` tinyint(3) unsigned NOT NULL,
	`area` varchar(50) NOT NULL,
	`data` text NOT NULL,
	`status` tinyint(3) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	`isdeleted` tinyint(3) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `menuid` (`menuid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_uni_account_modules`
--

CREATE TABLE IF NOT EXISTS `ims_uni_account_modules` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`module` varchar(50) NOT NULL,
	`enabled` tinyint(1) unsigned NOT NULL,
	`settings` text NOT NULL,
	PRIMARY KEY (`id`),
	KEY `idx_module` (`module`),
	KEY `idx_uniacid` (`uniacid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_uni_account_users`
--

CREATE TABLE IF NOT EXISTS `ims_uni_account_users` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`role` varchar(255) NOT NULL,
	`rank` tinyint(3) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `idx_memberid` (`uid`),
	KEY `uniacid` (`uniacid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_uni_group`
--

CREATE TABLE IF NOT EXISTS `ims_uni_group` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`name` varchar(50) NOT NULL,
	`modules` varchar(15000) NOT NULL,
	`templates` varchar(5000) NOT NULL,
	`uniacid` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_uni_settings`
--

CREATE TABLE IF NOT EXISTS `ims_uni_settings` (
	`uniacid` int(10) unsigned NOT NULL,
	`passport` varchar(200) NOT NULL,
	`oauth` varchar(100) NOT NULL,
	`jsauth_acid` int(10) unsigned NOT NULL,
	`uc` varchar(500) NOT NULL,
	`notify` varchar(2000) NOT NULL,
	`creditnames` varchar(500) NOT NULL,
	`creditbehaviors` varchar(500) NOT NULL,
	`welcome` varchar(60) NOT NULL,
	`default` varchar(60) NOT NULL,
	`default_message` varchar(2000) NOT NULL,
	`shortcuts` varchar(5000) NOT NULL,
	`payment` varchar(2000) NOT NULL,
	`stat` varchar(300) NOT NULL,
	`default_site` int(10) unsigned DEFAULT NULL,
	`sync` tinyint(3) unsigned NOT NULL,
	`recharge` varchar(500) NOT NULL,
	`tplnotice` varchar(1000) NOT NULL,
	`grouplevel` tinyint(3) unsigned NOT NULL,
	`mcplugin` varchar(500) NOT NULL,
	`exchange_enable` tinyint(3) unsigned NOT NULL,
	`coupon_type` tinyint(3) unsigned NOT NULL,
	`menuset` text NOT NULL,
	PRIMARY KEY (`uniacid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `ims_uni_verifycode`
--

CREATE TABLE IF NOT EXISTS `ims_uni_verifycode` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`receiver` varchar(50) NOT NULL,
	`verifycode` varchar(6) NOT NULL,
	`total` tinyint(3) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_userapi_cache`
--

CREATE TABLE IF NOT EXISTS `ims_userapi_cache` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`key` varchar(32) NOT NULL,
	`content` text NOT NULL,
	`lastupdate` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_userapi_reply`
--

CREATE TABLE IF NOT EXISTS `ims_userapi_reply` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`rid` int(10) unsigned NOT NULL,
	`description` varchar(300) NOT NULL,
	`apiurl` varchar(300) NOT NULL,
	`token` varchar(32) NOT NULL,
	`default_text` varchar(100) NOT NULL,
	`cachetime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `rid` (`rid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_users`
--

CREATE TABLE IF NOT EXISTS `ims_users` (
	`uid` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`groupid` int(10) unsigned NOT NULL,
	`username` varchar(30) NOT NULL,
	`password` varchar(200) NOT NULL,
	`salt` varchar(10) NOT NULL,
	`type` tinyint(3) unsigned NOT NULL,
	`status` tinyint(4) NOT NULL,
	`joindate` int(10) unsigned NOT NULL,
	`joinip` varchar(15) NOT NULL,
	`lastvisit` int(10) unsigned NOT NULL,
	`lastip` varchar(15) NOT NULL,
	`remark` varchar(500) NOT NULL,
	`starttime` int(10) unsigned NOT NULL,
	`endtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`uid`),
	UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_users_failed_login`
--

CREATE TABLE IF NOT EXISTS `ims_users_failed_login` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`ip` varchar(15) NOT NULL,
	`username` varchar(32) NOT NULL,
	`count` tinyint(1) unsigned NOT NULL,
	`lastupdate` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `ip_username` (`ip`,`username`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_users_group`
--

CREATE TABLE IF NOT EXISTS `ims_users_group` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`name` varchar(50) NOT NULL,
	`package` varchar(5000) NOT NULL,
	`maxaccount` int(10) unsigned NOT NULL,
	`maxsubaccount` int(10) unsigned NOT NULL,
	`timelimit` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_users_invitation`
--

CREATE TABLE IF NOT EXISTS `ims_users_invitation` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`code` varchar(64) NOT NULL,
	`fromuid` int(10) unsigned NOT NULL,
	`inviteuid` int(10) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	UNIQUE KEY `idx_code` (`code`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_users_permission`
--

CREATE TABLE IF NOT EXISTS `ims_users_permission` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL,
	`uid` int(10) unsigned NOT NULL,
	`type` varchar(30) NOT NULL,
	`permission` varchar(10000) NOT NULL,
	`url` varchar(255) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_users_profile`
--

CREATE TABLE IF NOT EXISTS `ims_users_profile` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uid` int(10) unsigned NOT NULL,
	`createtime` int(10) unsigned NOT NULL,
	`realname` varchar(10) NOT NULL,
	`nickname` varchar(20) NOT NULL,
	`avatar` varchar(100) NOT NULL,
	`qq` varchar(15) NOT NULL,
	`mobile` varchar(11) NOT NULL,
	`fakeid` varchar(30) NOT NULL,
	`vip` tinyint(3) unsigned NOT NULL,
	`gender` tinyint(1) NOT NULL,
	`birthyear` smallint(6) unsigned NOT NULL,
	`birthmonth` tinyint(3) unsigned NOT NULL,
	`birthday` tinyint(3) unsigned NOT NULL,
	`constellation` varchar(10) NOT NULL,
	`zodiac` varchar(5) NOT NULL,
	`telephone` varchar(15) NOT NULL,
	`idcard` varchar(30) NOT NULL,
	`studentid` varchar(50) NOT NULL,
	`grade` varchar(10) NOT NULL,
	`address` varchar(255) NOT NULL,
	`zipcode` varchar(10) NOT NULL,
	`nationality` varchar(30) NOT NULL,
	`resideprovince` varchar(30) NOT NULL,
	`residecity` varchar(30) NOT NULL,
	`residedist` varchar(30) NOT NULL,
	`graduateschool` varchar(50) NOT NULL,
	`company` varchar(50) NOT NULL,
	`education` varchar(10) NOT NULL,
	`occupation` varchar(30) NOT NULL,
	`position` varchar(30) NOT NULL,
	`revenue` varchar(10) NOT NULL,
	`affectivestatus` varchar(30) NOT NULL,
	`lookingfor` varchar(255) NOT NULL,
	`bloodtype` varchar(5) NOT NULL,
	`height` varchar(5) NOT NULL,
	`weight` varchar(5) NOT NULL,
	`alipay` varchar(30) NOT NULL,
	`msn` varchar(30) NOT NULL,
	`email` varchar(50) NOT NULL,
	`taobao` varchar(30) NOT NULL,
	`site` varchar(30) NOT NULL,
	`bio` text NOT NULL,
	`interest` text NOT NULL,
	`workerid` varchar(64) NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_video_reply`
--

CREATE TABLE IF NOT EXISTS `ims_video_reply` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`rid` int(10) unsigned NOT NULL,
	`title` varchar(50) NOT NULL,
	`description` varchar(255) NOT NULL,
	`mediaid` varchar(255) NOT NULL,
	`createtime` int(10) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `rid` (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_voice_reply`
--

CREATE TABLE IF NOT EXISTS `ims_voice_reply` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`rid` int(10) unsigned NOT NULL,
	`title` varchar(50) NOT NULL,
	`mediaid` varchar(255) NOT NULL,
	`createtime` int(10) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `rid` (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_wechat_attachment`
--

CREATE TABLE IF NOT EXISTS `ims_wechat_attachment` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned NOT NULL 			COMMENT '统一公众号 ',
	`acid` int(10) unsigned NOT NULL 				COMMENT '子公众号 ',
	`uid` int(10) unsigned NOT NULL 				COMMENT '管理员 ',
	`filename` varchar(255) NOT NULL 				COMMENT '上传时文件名',
	`attachment` varchar(255) NOT NULL 				COMMENT '图片：微信服务器图片地址  音频：本地相对于attachment如audios/2/2016/12/K2Aq72kjV78opzjf2q02KMmOZUZ6AM.amr ',
	`media_id` varchar(255) NOT NULL				COMMENT '上传返回的微信media_id',
	`width` int(10) unsigned NOT NULL				COMMENT '应该图片原始宽高',
	`height` int(10) unsigned NOT NULL,
	`type` varchar(15) NOT NULL						COMMENT 'image voice video thumb',
	`model` varchar(25) NOT NULL					COMMENT '值为perm  不清楚  ',
	`tag` varchar(5000) NOT NULL					COMMENT '图片与attachment一样 ',
	`createtime` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `media_id` (`media_id`),
	KEY `acid` (`acid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1   COMMENT '上传到微信服务器 ';

-- --------------------------------------------------------

--
-- 表的结构 `ims_wechat_news`
--

CREATE TABLE IF NOT EXISTS `ims_wechat_news` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`uniacid` int(10) unsigned DEFAULT NULL,
	`attach_id` int(10) unsigned NOT NULL,
	`thumb_media_id` varchar(60) NOT NULL,
	`thumb_url` varchar(255) NOT NULL,
	`title` varchar(50) NOT NULL,
	`author` varchar(30) NOT NULL,
	`digest` varchar(255) NOT NULL,
	`content` text NOT NULL,
	`content_source_url` varchar(200) NOT NULL,
	`show_cover_pic` tinyint(3) unsigned NOT NULL,
	`url` varchar(200) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `uniacid` (`uniacid`),
	KEY `attach_id` (`attach_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `ims_wxcard_reply`
--

CREATE TABLE IF NOT EXISTS `ims_wxcard_reply` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`rid` int(10) unsigned NOT NULL,
	`title` varchar(30) NOT NULL,
	`card_id` varchar(50) NOT NULL,
	`cid` int(10) unsigned NOT NULL,
	`brand_name` varchar(30) NOT NULL,
	`logo_url` varchar(255) NOT NULL,
	`success` varchar(255) NOT NULL,
	`error` varchar(255) NOT NULL,
	PRIMARY KEY (`id`),
	KEY `rid` (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
